use serde::{Deserialize, Serialize};
use validator::Validate;
use wanmesh_common::validator::validate_string_is_not_empty;

#[derive(Serialize, Deserialize, Validate, Debug, Clone)]
pub struct AddParams {
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub candidate_path_id: String,
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub segment_list_id: String,
    #[validate(range(min = 1))]
    pub weight: u32,
}


#[derive(Serialize, Deserialize, Validate, Default, Debug, Clone, Eq, PartialEq)]
pub struct Filter {
    pub candidate_path_id: Option<String>,
    pub segment_list_id: Option<String>,
}